import { useState, useEffect } from 'react'


function App() {
    let [count, setCount] = useState(0)
    useEffect(() => {
        // console.log('useEffect');
        const timer = setInterval(() => {
            setCount(count + 1)
        }, 1000);
    }, [count])

    const add = () => {
        setCount(count + 1)
    }


    return (
        <button onClick={add}>{count}</button>
    )
}

export default App;